package com.heima.utils.thread;

/**
 * @author xiaquanen
 * @version 1.0
 * @project heima-leadnews
 * @date 2024/7/21 16:37:06
 */
public class WeThreadLocalUtil {
    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    public static void setUserId(Integer id) {
        threadLocal.set(id);
    }

    public static Integer getUserId() {
        return threadLocal.get();
    }

    public static void remove() {
        threadLocal.remove();
    }

}
